<template>
  <div>
    <!-- <button ref="bu1"  id="newPage" onclick="window.open('http://192.168.2.12/zabbix/')">按钮点击</button> -->
    <!-- <button ref="bu1"  id="newPage" @click="test">按钮点击</button> -->
  </div>

</template>

<script>
import { resolveUrlPath, setUrlPath } from "@/util/util";
import { mapState, mapGetters } from "vuex";

  export default {
      name: "",
      data(){
        return {
          msg:""
        }
      },
      created() {
      },
      mounted() {
        this.$nextTick(function () {
          this.autoClick();
        })

      },
      computed: {
        ...mapGetters(["tagWel", "tagList", "isCollapse", "tag"]),
        nowTagValue: function() {
          return setUrlPath(this.$route);
        },
        tagListNum: function() {
          return this.tagList.length != 0;
        }
      },
      methods:{
        // openUrl(item) {
        //   this.$router.push({
        //     path: resolveUrlPath(item.value, item.label),
        //     query: item.query
        //   });
        // },
        eachTag(tag) {
          for (var key in this.tagList) {
            if (this.tagList[key].value == tag.value) {
              return key;
            }
          }
          return -1;
        },
        autoClick(){
          console.log("进入jenkins");
          let item={"close":true,"value":"/serviceop/jenkins"};
          const key = this.eachTag(item);
          console.log(key);
          let tag;
          //this.$store.commit("DEL_TAG", item);
           tag = this.tagList[key];
           console.log("tag是");
            console.log(tag);
            //this.openUrl(tag);
            window.open("http://192.168.0.51:9004/");
        }
      }
  }
</script>
